﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

using Enterprise.Infrastructure;
using Enterprise.Model.OfficeDocument;
using Enterprise.Service.OfficeDocument;
using Enterprise.Model.WorkFlow;
using Enterprise.Service.WorkFlow;
namespace Enterprise.UI.Web.Modules.OfficeDocument
{
    public partial class OfficeDocumentDetail : System.Web.UI.Page
    {
        string ODID = (string)Utility.sink("ODID", Utility.MethodType.Get, 0, 0, Utility.DataType.Str);
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                OnStart();
            }
        }

        private void OnStart()
        {
            OfficeDocService odService = new OfficeDocService();
            var query = odService.OfficeDocumentDisp(ODID);
            if (query != null)
            {
                lb_Dept.Text = Enterprise.Service.Department.DepartmentService.GetDepartMentName(query.ODDEPTID);
                lb_User.Text = Enterprise.Service.User.UserService.GetUserName(query.ODUSERID);
                lb_Name.Text = query.ODCNAME;
                lb_RName.Text = query.ODRNAME;
                lb_Content.Text = query.ODCREMARK;
                lb_RContent.Text = query.ODRREMARK;
                lb_Files.Text = query.ODFILES;
                lb_Time.Text = query.ODCREATETIME.ToString();

                WorkFlowProcessService wfpService = new WorkFlowProcessService();
                GridView1.DataSource = wfpService.WorkFlowProcessListByWorkFlow(query.ODID);
                GridView1.DataBind();
            }
        }

    }
}